<style>
li img{max-width:160px; height:90px; margin:5px}
.layui-input-block .layui-table td{border: none}
</style>
<input type="hidden" name="ad.id" value="#(ad.id)">
<div class="layui-form-item">
	<div class="layui-inline">
		<label class="layui-form-label layui-bg-blue">状态</label>
		<div class="layui-input-inline">
			<input type="radio" name="ad.status" value="on" title="启用" #if(ad.status == 'on' || ad.status == null) checked #end>
			<input type="radio" name="ad.status" value="off" title="禁用" #if(ad.status == 'off') checked #end>
		</div>
	</div>
	<div class="layui-inline">
		<label class="layui-form-label layui-bg-blue">排序</label>
		<div class="layui-input-inline">
			<input type="text" name="ad.sortNum" lay-verify="required|number" autocomplete="off" class="layui-input" value="#(ad.sortNum)">
		</div>
	</div>
</div>

<div class="layui-form-item">
	<div class="layui-inline">
		<label class="layui-form-label layui-bg-blue">标题</label>
		<div class="layui-input-inline">
			<input type="text" name="ad.title" lay-verify="required|title" autocomplete="off" class="layui-input" value="#(ad.title)">
		</div>
	</div>
	<div class="layui-inline">
		<label class="layui-form-label layui-bg-blue">设备</label>
		<div class="layui-input-inline">
			<select name="ad.device" lay-verify="required">
			#dictList(parentKey="device_type")
				#for(dict : dictList)
				<option value="#(dict.key)" #if(ad.device == dict.key) selected #end>#(dict.value)</option>
				#end
			#end
			</select>
		</div>
	</div>
</div>

<div class="layui-form-item">
	<label class="layui-form-label">子标题</label>
	<div class="layui-input-block">
		<input type="text" name="ad.subtitle" autocomplete="off" class="layui-input" value="#(ad.subtitle)">
	</div>
</div>

<div class="layui-form-item">
	<div class="layui-inline">
		<label class="layui-form-label layui-bg-blue">广告位置</label>
		<div class="layui-input-inline">
			<select name="ad.placeId" lay-verify="required">
				<option value="">-- 请选择 --</option>
				#for(adPlace : adPlaceList)
				<option value="#(adPlace.id)" #if(adPlace.id == ad.placeId) selected #end>#(adPlace.name) (#(adPlace.code))</option>
				#end
			</select>
		</div>
	</div>
	<div class="layui-inline">
		<label class="layui-form-label">生效时间</label>
		<div class="layui-input-inline">
			<input type="text" id="startTime" name="ad.startTime" id="date" autocomplete="off" class="layui-input">
		</div>
		<div class="layui-form-mid">-</div>
		<div class="layui-input-inline">
			<input type="text" id="endTime" name="ad.endTime" id="date" autocomplete="off" class="layui-input">
		</div>
	</div>
</div>

<div class="layui-form-item layui-form-text">
	<label class="layui-form-label">描述</label>
	<div class="layui-input-block">
		<textarea placeholder="请输入内容" name="ad.remark" class="layui-textarea">#(ad.remark)</textarea>
	</div>
</div>

<div class="layui-form-item">
	<label class="layui-form-label">跳转链接</label>
	<div class="layui-input-block">
		<input type="text" name="ad.url" class="layui-input" placeholder="点击广告时跳转的地址" value="#(ad.url)">
	</div>
</div>

<div class="layui-form-item">
	<div class="layui-inline">
		<label class="layui-form-label">跳转方式</label>
		<div class="layui-input-inline">
			<select name="ad.urlTarget" lay-verify="required">
				<option value="_blank" #if("_blank" == ad.urlTarget) selected #end>新窗口</option>
				<option value="_self" #if("_self" == ad.urlTarget) selected #end>当前窗口</option>
			</select>
		</div>
	</div>
</div>


<div class="layui-form-item">
	<div class="layui-inline">
		<label class="layui-form-label layui-bg-blue">类型</label>
		<div class="layui-input-inline">
			<select id="ID_ad_type" name="ad.type" lay-verify="required" lay-filter="selectAdType">
				<option value="">-- 请选择 --</option>
			#dictList(parentKey="ad_type")
				#for(dict : dictList)
				<option value="#(dict.key)" #if(dict.key == ad.type) selected #end>#(dict.value)</option>
				#end
			#end
			</select>
		</div>
	</div>
</div>

<div class="layui-form-item ad-type file">
	<label class="layui-form-label layui-bg-blue">文档</label>
	<div class="layui-input-block">
		<ul>
			<li class="hide_in_view">
				<table class="layui-table">
					<tr>
						<td width="10px">
							<input type="hidden" id="ID_ad_file_url" name="ad.file" value="#(ad.file)">
							<button type="button" class="layui-btn jfsa-select-image" jfsa-accept="doc" jfsa-input="ID_ad_file_url" jfsa-img="ID_ad_file_img">设置</button>
						</td>
						<td>
							<div class="layui-form-mid layui-word-aux"></div>
						</td>
					</tr>
				</table>
			</li>
			<li style="height: 90px">
				<img class="file" src="#(ctx)/manage/_assets/images/icon/file_96.png" id="ID_ad_file_img">
			</li>
		</ul>
	</div>
</div>

<div class="layui-form-item ad-type video">
	<label class="layui-form-label layui-bg-blue">视频</label>
	<div class="layui-input-block">
		<ul>
			<li class="hide_in_view">
				<table class="layui-table">
					<tr>
						<td width="10px">
							<input type="hidden" id="ID_ad_video_url" name="ad.video" value="#(ad.video)">
							<button type="button" class="layui-btn jfsa-select-image" jfsa-accept="video" jfsa-input="ID_ad_video_url" jfsa-img="ID_ad_video_img">设置</button>
						</td>
						<td>
							<div class="layui-form-mid layui-word-aux"></div>
						</td>
					</tr>
				</table>
			</li>
			<li style="height: 90px">
				<img onclick="Jfsa.reviewVideo(this);" review-src="#(ad.video)" src="#(ctx)/manage/_assets/images/icon/video_96.png" id="ID_ad_video_img">
			</li>
		</ul>
	</div>
</div>


<div class="layui-form-item ad-type audio">
	<label class="layui-form-label layui-bg-blue">音频</label>
	<div class="layui-input-block">
		<ul>
			<li class="hide_in_view">
				<table class="layui-table">
					<tr>
						<td width="10px">
							<input type="hidden" id="ID_ad_audio_url" name="ad.audio" value="#(ad.audio)">
							<button type="button" class="layui-btn jfsa-select-image" jfsa-accept="audio" jfsa-input="ID_ad_audio_url" jfsa-img="ID_ad_audio_img">设置</button>
						</td>
						<td>
							<div class="layui-form-mid layui-word-aux"></div>
						</td>
					</tr>
				</table>
			</li>
			<li style="height: 90px">
				<img onclick="Jfsa.reviewAudio(this);" review-src="#(ad.audio)" src="#(ctx)/manage/_assets/images/icon/audio_96.png" id="ID_ad_audio_img">
			</li>
		</ul>
	</div>
</div>

<div class="layui-form-item ad-type image">
	<label class="layui-form-label layui-bg-blue">图片</label>
	<div class="layui-input-block">
		<ul>
			<li class="hide_in_view">
				<table class="layui-table">
					<tr>
						<td width="10px">
							<input type="hidden" id="ID_ad_img_url" name="ad.img" value="#(ad.img)">
							<button type="button" class="layui-btn jfsa-select-image" jfsa-accept="image" jfsa-input="ID_ad_img_url" jfsa-img="ID_ad_img_img">设置</button>
						</td>
						<td>
							<div class="layui-form-mid layui-word-aux"></div>
						</td>
					</tr>
				</table>
			</li>
			<li style="height: 90px">
				<img onclick="Jfsa.reviewImage(this);" src="#(ad.img)" id="ID_ad_img_img">
			</li>
		</ul>
	</div>
</div>
<div class="layui-form-item ad-type image">
	<div class="layui-inline">
		<label class="layui-form-label">图片明暗</label>
		<div class="layui-input-inline">
			<select name="ad.imgLightness">
				<option value="Light" #if("Light" == ad.imgLightness) selected #end>明亮</option>
				<option value="Dark" #if("Dark" == ad.imgLightness) selected #end>黑暗</option>
			</select>
		</div>
	</div>
</div>

<div class="layui-form-item ad-type goods">
	<label class="layui-form-label layui-bg-blue">关联商品</label>
	<div class="layui-input-block">
		<input type="text" name="ad.goodsIds" class="layui-input" placeholder="英文逗号隔开各商品ID，如2,34,41" value="#(ad.goodsIds)">
	</div>
</div>

<div class="layui-form-item ad-type video audio image">
	<label class="layui-form-label">封面图片</label>
	<div class="layui-input-block">
		<ul>
			<li class="hide_in_view">
				<table class="layui-table">
					<tr>
						<td width="10px">
							<input type="hidden" id="ID_ad_cover_url" name="ad.cover" value="#(ad.cover)">
							<button type="button" class="layui-btn jfsa-select-image" jfsa-accept="image" jfsa-input="ID_ad_cover_url" jfsa-img="ID_ad_cover_img">设置</button>
						</td>
						<td>
							<div class="layui-form-mid layui-word-aux"></div>
						</td>
					</tr>
				</table>
			</li>
			<li style="height: 90px">
				<img onclick="Jfsa.reviewImage(this);" src="#if(ad.cover)#(ad.cover)#end" id="ID_ad_cover_img">
			</li>
		</ul>
	</div>
</div>
